/* CommandShell.java
 * Author: liuex
 * 2007-12-14 ����12:51:38
 *
 * Note: 
 */
package org.lex.swing.widgets.console.demo.windows;

import java.io.IOException;
import java.io.Writer;


public abstract class CommandShell {
	protected static int DEFAULT_BUFFER_SIZE = 1024;

	public static CommandShell createShell(Writer stdOut, Writer stdErr) throws IOException {
		ProcessBuilder builder = new ProcessBuilder("cmd");
		return new WindowsCommandShell(builder.start(), stdOut, stdErr);
	}

	protected Process shell = null;

	protected CommandShell(Process shell) {
		super();
		this.shell = shell;
	}

	public abstract void execute(String command) throws IOException;
}
